/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

    
function toUrlParams(json){
    var params  = Object.keys(json).map(function (key) {
        // body...        
        return encodeURIComponent(key) + "=" + encodeURIComponent(json[key]);
        
    }).join("&");
    return params;
}

function formatterDate (date) {
    var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
    var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"
        + (date.getMonth() + 1);
    var hor = date.getHours();
    var min = date.getMinutes();
    var sec = date.getSeconds();
    return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
};

